package com.xiaoma.weblog.common.domain.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaoma.weblog.common.domain.dos.UserRoleDO;

import java.util.List;

/**
 * @ClassName UserRoleMapper
 * @Description:
 * @Author: 小马
 * @CreateDate: 2025/3/28 9:17
 * @Version: 1.0
 */
public interface UserRoleMapper extends BaseMapper<UserRoleDO> {
    default List<UserRoleDO> selectByUserName(String username) {
        LambdaQueryWrapper<UserRoleDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(UserRoleDO::getUsername, username);
        return selectList(lambdaQueryWrapper);
    }
}